package net.sky.oa.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *内部消息员工表
 *ImsMsgUser.@author hond
 */
@Entity
@Table(name = "IMS_MSG_USER")//内部消息员工表
public class ImsMsgUser implements Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields
	private Long id;
	private Date sendtime;    //发送时间
	private Date recievetime; //查收时间
	private Integer status;      //状态
	private SysEmployee susr;   //发送人
	private SysEmployee fusr;   //转发人
	private SysEmployee rusr;   //接收人
	private ImsMessage message;//段消息id

	// Constructors

	/** default constructor */
	public ImsMsgUser() {
	}

	/** minimal constructor */
	public ImsMsgUser(Long id) {
		this.id = id;
	}
	
	@Id
	@SequenceGenerator(name="SQ_IMSMSGUSER_ID",sequenceName="SQ_IMSMSGUSER_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_IMSMSGUSER_ID")
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	@Temporal(TemporalType.DATE)
	@Column(name = "SENDTIME", length = 7)
	public Date getSendtime() {
		return this.sendtime;
	}

	public void setSendtime(Date sendtime) {
		this.sendtime = sendtime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "RECIEVETIME", length = 7)
	public Date getRecievetime() {
		return this.recievetime;
	}

	public void setRecievetime(Date recievetime) {
		this.recievetime = recievetime;
	}

	@Column(name = "STATUS", precision = 2, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SUSR_ID")
	public SysEmployee getSusr() {
		return this.susr;
	}

	public void setSusr(SysEmployee susr) {
		this.susr = susr;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FUSR_ID")
	public SysEmployee getFusr() {
		return this.fusr;
	}

	public void setFusr(SysEmployee fusr) {
		this.fusr = fusr;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "RUSR_ID")
	public SysEmployee getRusr() {
		return this.rusr;
	}

	public void setRusr(SysEmployee rusr) {
		this.rusr = rusr;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MESSAGE_ID")
	public ImsMessage getMessage() {
		return this.message;
	}

	public void setMessage(ImsMessage message) {
		this.message = message;
	}

}